﻿using System.Windows;
using HomeRun.AspectCore.DataObserver;
using HomeRun.DB.Model;
using HomeRun.AspectCore.Commands;
using System.Xml.Linq;



namespace HomeRun.UI
{
    /// <summary>
    /// Interaktionslogik für MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        SNDeveloper m_developer;
        private DataObserver m_dataObserver;
        public MainWindow()
        {
            InitializeComponent();
            m_developer = new SNDeveloper { Id = 1, Name = "Monika", Allocate = 0.65 };
            m_dataObserver = new DataObserver(m_developer);
        }

        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            wpfPropertyGrid1.SelectedObject = m_developer;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            XElement xElement = m_dataObserver.GenUpdateCmd();
            this.textBox1.Text = m_dataObserver.GenUpdateCmd().ToString();
            Command updateCmd = new Command(xElement);
            //updateCmd.Execute();
        }

        
    }
}
